package info.androidhive.jsonparsing;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import info.androidhive.jsonparsing.R;

public class SingleContactActivity  extends Activity {
	
	// JSON node keys
	private static final String TAG_NUMBERSONG = "id";
	private static final String TAG_TITLE = "title";
	private static final String TAG_LYRIC = "lyric";
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_contact);
        
        // getting intent data
        Intent in = getIntent();
        
        // Get JSON values from previous intent
        String numberSong = in.getStringExtra(TAG_NUMBERSONG);
        String title = in.getStringExtra(TAG_TITLE);
        String lyric = in.getStringExtra(TAG_LYRIC);
        
        // Displaying all values on the screen
        TextView lblName = (TextView) findViewById(R.id.name_label);
        TextView lblEmail = (TextView) findViewById(R.id.email_label);
        TextView lblMobile = (TextView) findViewById(R.id.mobile_label);
        
        lblName.setText(numberSong);
        lblEmail.setText(title);
        lblMobile.setText(lyric);
    }
}
